<?php
namespace Addons\Message;


use Addons\Message\Model\MessageMsgModel;
use Addons\Processor;

class SubProcessor extends Processor {

    public function handler() {
        $info = (new MessageMsgModel())->find(1);

        // 判断是否是关注事件
        if ($this->msgObj->isSubscribeEvent()) {
            //向用户回复消息
            $this->msgObj->text($info['welcome']);
        }
        // 默认消息回复
        if ($this->msgObj->isTextMsg()) {
            $this->msgObj->text($info['default']);
        }

    }
}